//
//  AppDelegate+Common.m
//  XiaoMiao
//
//  Created by 23 on 2017/11/22.
//  Copyright © 2017年 smallyou. All rights reserved.
//

#import "AppDelegate+Common.h"
#import "OpenShareHeader.h" //分享

@implementation AppDelegate (Common)

- (void)setupCommonWithApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    //初始化网络配置
    [AppNetwork updateBaseUrl:kApiServer];
    [AppNetwork enableInterfaceDebug:YES];
    [AppNetwork configRequestType:AppRequestTypePlainText responseType:AppResponseTypeJSON callbackOnCancelRequest:NO];
    [AppNetwork setTimeout:100];
    
    
    //适配iOS11
    if (@available(iOS 11.0, *)) {
        UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        UITableView.appearance.estimatedRowHeight = 0;
        UITableView.appearance.estimatedSectionFooterHeight = 0;
        UITableView.appearance.estimatedSectionHeaderHeight = 0;
        UITableView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }
    
    
    //状态栏
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
    
    
    //键盘
    IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
    manager.enable = YES;
    manager.shouldResignOnTouchOutside = YES;
    manager.shouldToolbarUsesTextFieldTintColor = YES;
    manager.enableAutoToolbar = YES;
    
    [OpenShare connectQQWithAppId:kQQAppId]; //QQ
    [OpenShare connectWeixinWithAppId:kWechatAppId]; //微信
    
}


@end
